package com.example.helloandroid;

import android.app.Activity;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.RotateDrawable;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;


public class MainActivity extends Activity{
	RotateDrawable mDrawable;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
    	
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        ImageView imageView = (ImageView)findViewById(R.id.imageView1);
        mDrawable = (RotateDrawable)imageView.getDrawable();
        Button btn = (Button)findViewById(R.id.button1);
        btn.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				int level = mDrawable.getLevel();
				level = (level+1000)%10000;
				mDrawable.setLevel(level);
				
			}
		});
        
        int myColor = getResources().getColor(R.color.color_red);
        //String myMessage = getResources().getString(R.string.);
    }


    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.main, menu);
        return true;
    }
    
}
